Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSP-695] WordPress 6.5 font library documentation and behavior #8867

Merged
merged 35 commits into from
Mar 19, 2024

Conversation

jazzsequence
Copy link
Contributor

@jazzsequence jazzsequence commented Feb 14, 2024

Summary

Release Notes - Release notes for WordPress 6.5 including documentation about the Font Library
WordPress Configuration Guide - Adds a new guide for using the WP Font Library, how our filter works and how to override it, and considerations about either approach.

Effect

The WordPress Font Library introduces a new type of asset to WordPress sites, fonts. This opens up fundamental questions about how best to make use of these assets. As an opinionated platform, our belief is that, on day one, the font library should just work. As such, we have introduced code in our pantheon-mu-plugin to change the default behavior of the WP Font Library such that the default location for fonts to be stored is a (writeable on Pantheon) wp-content/uploads/fonts/ directory. This diverges from the WP core functionality of storing them in wp-content/fonts.

In a version controlled platform, the underlying question to consider here is: Are fonts more like media files (e.g. "I don't care where they are written and I should be able to add them to my live site directly.") or are they more like plugins and themes (e.g. "I want to manage the fonts in use on my site and commit them to version control.")?

We have opted for the former (fonts are like media files) whilst allowing teams to restore the default functionality by overriding our choice.

This PR documents the change in WordPress core and our approach.

Remaining Work and Prerequisites

  • Update docs with functional links to release notes.
  • Update docs with functional links to Font Library docs.

Dependencies and Timing

  • Request for comments

Release:

  • When ready
  • After date: March 26, 2024 (WordPress 6.5 anticipated release date)

Post Launch

Do not remove - To be completed by the docs team upon merge:

  • Redirect /old-path/ => /new-path/ (if applicable)
  • Include/exclude pages ^ respectively within docs search service provider (if applicable)
  • For Heroes - add a props post to the discussion board.
  • Remove from the project board

@jazzsequence jazzsequence self-assigned this Feb 14, 2024
@jazzsequence jazzsequence requested review from a team as code owners February 14, 2024 19:55
@jazzsequence jazzsequence marked this pull request as draft February 14, 2024 19:55
@stevector
Copy link
Contributor

Thanks @jazzsequence for thinking through these changes. I'll need to set aside some thinking time too!

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview


The distinction between the two approaches for handling fonts depends what works best for your workflow and whether you consider your fonts to be handled more like media files or more like themes and plugins.

**If you consider fonts to be more like media files**, use the default Pantheon behavior added in our `mu-plugin`. This makes it easier to _install fonts onto production sites_ but perhaps more difficult to _synchronize_ those fonts on the lower environments (test and dev).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the default Pantheon filter, do fonts move between environments with a "clone files" workflow as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few things I need to test. That's one. I also have a couple open questions that I posted in #core-editor Slack: https://wordpress.slack.com/archives/C02QB2JS7/p1707937998405009

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I smashed that subscribe button for more jazzsequence gutenberg goodness.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I'm seeing:

  1. Install font on live site
  2. Pull Live db down to Dev and sync files
  3. The font appears in the font manager but is not active
  4. Clicking into the font, selecting it and clicking update activates it

So, to answer your question, it does appear that they are pulled down when you clone the DB and files (I suspect you would need to clone the DB and files in order to get them), but there is an additional step to actually use them on the lower environment you pulled down to. I will update the doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, to be clear, I think the "active" value is similar to Plugin/Theme "activation", meaning it's there it's just not "available". It's similar, I believe, to the fact that when I cloned down my DB and files from Live to Dev, my FSE theme was active, but the specific theme style that I was using on Live was not selected on Dev.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's curious that activation status doesn't carry through db clone the way plugin activation status would.

Copy link
Contributor Author

@jazzsequence jazzsequence Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not sure what this tells me exactly, because surely these settings are stored in the database somewhere, but whatever the full site editor is doing with styles, it's doing the same thing with fonts. ¯\_(ツ)_/¯

@jkudish
Copy link
Contributor

jkudish commented Feb 14, 2024

Giving this a +1 - I think the approach makes sense. Treat it like WP does (generic upload) by default but with the option to switch to version controlled approach if desired.

@bensheldon
Copy link
Contributor

Are fonts more like media files ... or are they more like plugins and themes...

I'll offer that I think of a font as the latter, because I'm not sure how one would make use of an uploaded font without also modifying the theme file (other than making the change with inline styles but in that case one could also reference a font asset inline as a generic upload as well).

@jazzsequence
Copy link
Contributor Author

jazzsequence commented Feb 15, 2024

@bensheldon

I'm not sure how one would make use of an uploaded font without also modifying the theme file (other than making the change with inline styles but in that case one could also reference a font asset inline as a generic upload as well).

If it helps to contextualize the feature, the Font Library is built into the Full Site Editor -- meaning that fonts and styles, while informed by the theme, are independent of the theme. The idea is that you could download (or build) a theme that's compatible with FSE and that theme might give you 4 fonts to work with. But you don't like those fonts for whatever reason, and you want to use one that you've either previously uploaded or are uploading (or installing from Google) new. That font could then be activated next year when you switch to the Twenty Twenty Five theme (or whatever).

Themes can use the Font Library to install/download their own fonts via the API it adds as well, but the Font Library/management aspect of it is kind of independent of the theme.

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence
Copy link
Contributor Author

👀 Doc Preview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

jazzsequence and others added 2 commits February 16, 2024 16:03
Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>
Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

1 similar comment
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence
Copy link
Contributor Author

Last update before I think we're good to go with this:

I've updated the PR to remove the release note. I'll be writing up a release note separately for WordPress 6.5 so I will include the Font Library stuff in that.

Some of the logic has changed (again) since this was first drafted: now default WordPress core behavior is if the wp-content directory is writeable, fonts are installed in wp-content/fonts otherwise, fonts are installed in wp-content/uploads/fonts. This means it always works, but it creates a discrepancy between local development environments and Pantheon environments if left to the default behavior. I've updated the docs to reflect this, explain the problem, and reshaped some of the language about overriding.

Finally, the infinite loop bug when using wp_get_upload_dir inside the font_dir filter was resolved, so I removed the note. This should be g2g once I get a ✅.

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link
Member

@pwtyler pwtyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, prefer to move the unrelated release note out though.

jazzsequence and others added 2 commits March 19, 2024 14:51
Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>
Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>
Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

Copy link

⚡ Deployed with Pantheon Decoupled

This build was successfully deployed with Pantheon. You can track the build logs here.

👀 Preview: https://pr-8867-documentation.appa.pantheon.site
🛠️ Manage in Pantheon: https://dashboard.pantheon.io/site/2b30153f-e8b1-4427-b076-6109e704ba5d/overview

@jazzsequence jazzsequence merged commit 89516a0 into main Mar 19, 2024
8 checks passed
@jazzsequence jazzsequence deleted the cmsp-695-6.5-font-library-docs branch March 19, 2024 20:58
rachelwhitton pushed a commit that referenced this pull request Mar 28, 2024
* add draft release notes for WP 6.5 font library

* add a guide under WordPress Configuration that talks about the WP Font Library

* rename the release note with the expected release date

* remove nonfunctional links

* add g'berg issue

* update notes to maintain consistency

* update publish date

* add troubleshooting info if the FS is not writeable

* some copy changes

* fix image url

* add new screenshots

* update info about handling fonts like media files

* update troubleshooting steps

* add one more troubleshooting Q & A

* specify in the admin

* Be more clear that this only happens if you've changed the Pantheon setting

Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>

* remove references to "restoring wp default behavior"

* note how we prioritized our filter

* add details to how 'active' fonts work

* update copy about post type
this was already noted in the considerations, so we don't need to explain it again here

* simplify language

Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>

* more simplification

Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>

* clarify introductory paragraph

* discuss (new) wp default behavior and why we're keeping our mu-plugin behavior

* remove note, this is no longer an issue

* update language about overriding our font_dir filter

* add our G'berg issue for font handling for manual uploads

* add link to more resources

* remove release notes for wp 6.5 from this PR

* remove link to release post (that doesn't exist)
so we can publish this page sooner

* add new plugin tag for PAPC release note

* add a new release note for the MU plugin release

* note when developing locally

Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>

* remove unrelated release note update

Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>

---------

Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants